package com.swotxu.mall.member.controller;

import com.swotxu.common.utils.R;
import com.swotxu.mall.member.entity.MemberEntity;
import com.swotxu.mall.member.feign.TestCouponFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Date: 2020/12/14 23:25
 * @Author: swotXu
 */
@RestController
@RequestMapping("test/member")
public class TestCouponFeignController {

    @Autowired
    private TestCouponFeignService testCouponFeignService;

    @RequestMapping("/coupons")
    public R coupons(){
        R membercoupons = testCouponFeignService.membercoupons();
        MemberEntity memberEntity = new MemberEntity();
        memberEntity.setNickname("张三");
        return R.ok().put("member", memberEntity).put("coupons", membercoupons.get("coupons"));
    }
}
